import Vue from 'vue'
import Router from 'vue-router'
import discover from '@/components/discover/discover'
import playlist from '@/components/playlist/playlist'
import mvs from '@/components/mvs/mvs'
import playlists from '@/components/playlists/playlists'
import songs from '@/components/songs/songs'
import MV from '@/components/MV/MV'
import reslut from '@/components/reslut/reslut'

Vue.use(Router)

const VueRouterPush = Router.prototype.push;
Router.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err)
}

export default new Router({
  routes: [
    {
      path:'/',
      redirect:'/discover'
    },
    {
      path: '/discover',
      component: discover
    },
    {
      path: '/playlist',
      component: playlist
    },
    {
      path: '/songs',
      component: songs
    },
    {
      path: '/MV',
      component: MV
    },
    {
      path: '/reslut',
      component: reslut
    },
    {
      path: '/playlists',
      component: playlists
    },
    {
      path: '/mvs',
      component: mvs
    },
  ]
})
